using Godot;
using System;

public partial class SceneBase : Node2D, ISave
{
	// Called when the node enters the scene tree for the first time.
	public SceneId sceneId { get; set; }

	public SceneType sceneType { get; set; }
	public virtual void EnterScene()
	{

	}

	public virtual Godot.Collections.Dictionary<string, Variant> GetSaveData()
	{
		return null;
	}

	public virtual void Load(Godot.Collections.Dictionary<string, Variant> data)
	{

	}

	public override void _Ready()
	{
		base._Ready();
		addListener();
	}

	protected virtual void addListener()
	{
		EventManager.getInstance().addListener(EventType.EVENT_CATCH_SHOT_FINISH, onShowSaveIcon);
		EventManager.getInstance().addListener(EventType.EVENT_FINISH_SAVE, onFinishSave);
	}


	private void onShowSaveIcon(object sender, EventParams e)
	{
		ViewManager.getInstance().open("SaveIconView");
	}

	private void onFinishSave(object sender, EventParams e)
	{
		ViewManager.getInstance().close("SaveIconView");
	}


}
